#!/bin/sh
Cur_day=`date -d '1 day ago' +%Y%m%d`
TIME_WAIT_MAX=36000
TIME_SLEEP=300
#运行时传城市参数进来 $1
bj_today=$1"_$Cur_day"
Local_inputdata_path=/usr/local/apps/hadoop/data
Local_code_path=/usr/local/apps/hadoop/hezu
Local_hadoop_path=/usr/local/apps/hadoop-2.7.2/share/hadoop/tools/lib
#export data from mysql(default==beijing)
#运行时传该城市对应的数据库名作为第二个参数
#python /usr/local/apps/hadoop/hezu/dumpdata.py $2
#compress the data, format=gzip
#gzip $Local_inputdata_path/house_hezu_gov
#step3
hadoop jar $Local_hadoop_path/hadoop-streaming-2.7.2.jar \
-input /house_hezu/$bj_today/house_hezu_gov.gz \
-output  /house_hezu/$bj_today/mapred3 \
-mapper '/usr/bin/php mapper_3.php' \
-reducer '/usr/bin/php reducer3_1.php' \
-file '/usr/local/apps/hadoop/hezu/mapper_3.php' \
-file '/usr/local/apps/hadoop/hezu/reducer3_1.php'

